<?php namespace Admin\Controller; 
/**
 * 评论控制器
 */
class CommentController extends CommonController{
		private $comment = null;
		public function __init(){
			parent::__init();
			$this->comment = new \Common\Model\Comment();
		}
		
		//显示页
		public function index(){
			$page = Page::row(8)->make($this->comment->count());
			$cData = $this->comment->join('article','article_aid','=','aid')->limit(Page::limit())->get();
			$this->assign('page',$page);
			$this->assign('total',$this->comment->count());
			$this->assign('cData',$cData);
		 	$this->display();
		}
		
		//删除
		public function  del(){
				$coid = Q('coid',0,'intval');
				if($this->comment->delete($coid)) $this->success('删除成功,马上为您跳转...',U('index'));
		}
}